package com.kratos.designdemo.service.impl;

import com.kratos.designdemo.controller.vo.OrderVo;
import com.kratos.designdemo.enums.OrderStatusEnum;
import com.kratos.designdemo.service.OrderStatusAbstract;
import com.kratos.designdemo.service.OrderStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author kratos
 * @date 2022-06-09 14:32:01
 */
@Service
@Slf4j
public class PaidImpl extends OrderStatusAbstract implements OrderStatusService {
    @Override
    public boolean support(OrderVo orderVo) {
        return orderVo.getStatus().equals(OrderStatusEnum.PAID.getCode());
    }

    @Override
    public void update(OrderVo orderVo) {
        this.paid(orderVo);
    }

    @Override
    public void paid(OrderVo orderVo) {
        check(orderVo);
        OrderStatusService.super.paid(orderVo);
        log.info("开始处理订单支付业务........");
    }
}
